package com.ww.springboot.boot.javabase.stream;

import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2022-04-09 15:52
 */
public class StreamDemo2 {

    public static void main(String[] args) {
        //1.数组转列表
        int[] array = {1,2,3,4,5};
        System.out.println(array);
        //boxed 将基础数据类型,装箱  引用类型无需boxed
        System.out.println(Arrays.stream(array).boxed().map(i -> i * i).collect(Collectors.toList()));
    }
}
